package com.qyhl.webtv.module_news.news.union.government.detail;


import com.qyhl.webtv.commonlib.entity.news.MeetingRoomBean;
import com.qyhl.webtv.commonlib.entity.news.NewsBean;
import com.qyhl.webtv.commonlib.entity.news.UnionBean;
import com.qyhl.webtv.commonlib.entity.news.UnionRecBean;

import java.util.List;

/**
 * Created by qyhl on 2017/12/1.
 */

public class GovernmentDetailPresenter implements GovernmentDetailContract.GovernemntDetailPresenter {
    private GovernmentDetailModel mModel;
    private GovernmentDetailActivity mView;

    public GovernmentDetailPresenter(GovernmentDetailActivity mView) {
        this.mView = mView;
        this.mModel = new GovernmentDetailModel(this);
    }
    @Override
    public void getTop(String sections) {
        mModel.getTop(sections);
    }

    @Override
    public void getMiddle(String sections) {
        mModel.getMiddle(sections);
    }

    @Override
    public void getBottom(String sections) {
        mModel.getBottom(sections);
    }

    @Override
    public void setMiddle(List<UnionBean> beanList) {
        mView.setMiddle(beanList);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            default:
                break;
        }
    }

    @Override
    public void setTop(List<NewsBean> beanList) {
        mView.setTop(beanList);
    }

    @Override
    public void setTopError(String msg) {
        mView.setTopError(msg);
    }

    @Override
    public void setBottom(List<UnionRecBean> beanList) {
        mView.setBottom(beanList);
    }

    @Override
    public void setBottomError(int code,String msg) {
        mView.setBottomError(code,msg);
    }

    @Override
    public void getMeetingRoom(String catalogId) {
        mModel.getMeetingRoom(catalogId);
    }

    @Override
    public void getMeetingSuccess(MeetingRoomBean bean) {
        mView.getMeetingSuccess(bean);
    }

    @Override
    public void getMeetingError() {
        mView.getMeetingError();
    }
}
